<template>
  <div class="error-container">
    <div class="error-content">
      <h1 class="error-code">404</h1>
      <div class="error-desc">很抱歉，您访问的页面不存在</div>
      <div class="error-action">
        <el-button type="primary" @click="goHome">返回首页</el-button>
        <el-button @click="goBack">返回上一页</el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  
  .error-content {
    text-align: center;
    
    .error-code {
      font-size: 160px;
      color: #409EFF;
      margin: 0;
      font-weight: bold;
      text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .error-desc {
      color: #606266;
      font-size: 24px;
      margin: 20px 0 30px;
    }
    
    .error-action {
      margin-top: 30px;
      
      .el-button {
        margin: 0 10px;
      }
    }
  }
}
</style>